﻿using Luna小店.DTO;
using Luna小店.service;
using mendian;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Luna小店.UC.款式管理.service
{
    public class 款式Service
    {
        /// <summary>
        /// 上传款式图片
        /// </summary>
        /// <param name="styleId"></param>
        /// <param name="ofd"></param>
        /// <returns></returns>
        public static String 上传款式图(string styleId, OpenFileDialog ofd)
        {
            return
                FileService.UploadRequest(
                    URL.接口url + "/image/uploadStyleImage?styleId=" + styleId,
                    ofd.FileName,
                    Path.GetFileName(ofd.FileName),
                    "multipartFile"
                    );
        }

        /// <summary>
        /// get款式图片
        /// </summary>
        /// <param name="styleId"></param>
        /// <returns></returns>
        public static String get款式图(string styleId)
        {
            return
                URL.图片url + URL.款式图片路径 + RestCall.httpGetMethod(URL.接口url + "/image/getStyleImagePathByStyleId?styleId=" + styleId);
        }
    }
}
